<?php
/**
 * Created by PhpStorm.
 * User: jochen
 * Date: 2016/11/4
 * Time: 下午4:08
 */

Route::get('{view}.html', function($_view) {
    $viewController = new App\Http\Controllers\ViewController();
    if (method_exists($viewController, $_view)) {
        return call_user_func([$viewController, $_view]);
    }
    abort(404);
});

//官网页面
$host = $_SERVER['HTTP_HOST'] ?? '';
if ($host === env('SITE_URL', 'www.eweilink.com')) {
    Route::get('/', 'IndexController@index');
    //二维码下载
    Route::get('/qrcode', 'IndexController@qrCode');
    //本地下载
    Route::get('/downloads', 'IndexController@downloads');
} else {
    Route::get('/', 'HomeController@index');
    Route::get('/forget/password', 'HomeController@forget');
}

Route::options('/plugins/{wxClientId}', 'IndexController@pluginName');
Route::post('/api/verify', 'IndexController@checkVerifyMsg');